﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NDimArrayNamespace;

namespace QLabValues
{
    public class QCell : NDimArrayNamespace.NDimArray<IQLabValue>, IQLabValue
    {
        public QCell(params int[] dimensionSize)
            : base(dimensionSize)
        {
        }
        public QCell(IQLabValue[] data, params int[] dimensionSize)
            : base(data, dimensionSize)
        {
        }

        public QCell(IQLabValue iq)
        {
            // TODO: constructor for cell
        }

        public object Clone()
        {
            return (object)new QCell(Data, DimensionSize); // svo kopiranje se vec vrsi u konstruktoru
        }

        public QCell GetSubArray(int[][] subNDimArrayCoordinates)
        {
            NDimArray<IQLabValue> tempArray = base.GetSubNDimArray(subNDimArrayCoordinates);
            return new QCell(tempArray.Data, tempArray.DimensionSize);
        }

        public QCell SubAssignment(QCell matrix, int[][] subNDimArrayCoordinates)
        {
            NDimArray<IQLabValue> tempArray = base.SubscriptedAssignment(new NDimArray<IQLabValue>(matrix.Data, matrix.DimensionSize), subNDimArrayCoordinates);
            return new QCell(tempArray.Data, tempArray.DimensionSize);
        }

        public IQLabValueType GetEnumType()
        {
            return IQLabValueType.QCell;
        }
    }
}
